package main

import "time"

func main() {
	ch := make(chan int, 2)
	go setChannel(ch)
	for v := range ch {
		println(v)
	}
}

func setChannel(ch chan int) {
	for {
		time.Sleep(time.Second)
		ch <- 1
	}
}
